#pragma once

#include "CommInc.h"

using namespace std;
struct UserInfo
{
	string AccountId;
	string Password;
	int LoginType = 0;
	int RepeatedCount = 0;
};

struct Requests
{
	int FuncId = 0;
	int TimeInterval = 0;
	map<int, string> params;

	bool operator<(const Requests& rhs) const
	{
		return FuncId < rhs.FuncId;
	}
};

class Configs final
{
public:
	static Configs& GetInstance();

	pair<string, int> GetAddr() const;

	const map<string, Requests>& GetLoginReqs() const;

	int GetRepeatCount() const
	{
		return m_RepeatCount;
	}

	const map<int, Requests>& GetRequests() const
	{
		return m_Requests;
	}

private:
	void LoadConfig(const string& filename);

	Configs();
	~Configs() = default;

private:
	string m_IP;
	int m_Port = 0;

	int m_RepeatCount = 0;
	//kye = account
	map<string, Requests> m_LoginReqs;

	map<int, Requests> m_Requests;
};